package com.epsoft.odin7cj.flow.example;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class C11JobServiceTask {

	private static Logger logger = LoggerFactory.getLogger(C11JobServiceTask.class);
	
	public static void main1(String[] args) {
		
		ProcessEngine engine = ProcessEngines.getDefaultProcessEngine();
		
		RepositoryService repositoryService = engine.getRepositoryService();
		
		RuntimeService runtimeServic = engine.getRuntimeService();
		
		Deployment deploy = repositoryService.createDeployment().addClasspathResource("bpmn/c11-job-service-task.bpmn").deploy();
	
		ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().deploymentId(deploy.getId()).singleResult();
	
	    ProcessInstance pi = runtimeServic.startProcessInstanceById(pd.getId());
	    
	    System.out.println("pd.getId():"+pd.getId());
	}
}
